package com.gljx.web.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;


import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.WithholdItem;
import com.gljx.web.dao.CommonDao;
import com.gljx.web.dao.WithholdItemMapper;
import com.gljx.web.service.WithholdItemService;


@Service
@Transactional
public class WithholdItemServiceImpl extends CommonDao implements WithholdItemService {
	@Resource
	private WithholdItemMapper withholdItemMapper;
	
	/**
	 * @author wjb
	 * 查询当前登录人的扣款项目
	 */
	@Override
	public List<WithholdItem> selectWithholdItem(String fcompanyid) {
		// TODO Auto-generated method stub
		return withholdItemMapper.selectWithholdItem(fcompanyid);
	}
	
	/**
	 * 增加扣款项目信息
	 */
	@Override
	public int addWithholdItem(WithholdItem withholdItem) {
		// TODO Auto-generated method stub
		return withholdItemMapper.insertSelective(withholdItem);
	}
	
	/**
	 * 查询单条扣款项目信息
	 */
	@Override
	public WithholdItem queryWithholdItemByFid(String fid) {
		// TODO Auto-generated method stub
		return withholdItemMapper.selectByPrimaryKey(fid);
	}
	/**
	 * 修改扣款项目的信息
	 */
	@Override
	public int updateWithholdItemByFid(WithholdItem withholdItem) {
		// TODO Auto-generated method stub
		return withholdItemMapper.updateByPrimaryKeySelective(withholdItem);
	}
	/**
	 * 删除扣款信息
	 */
	@Override
	public int deleteByPrimaryKey(String fid) {
		// TODO Auto-generated method stub
		return withholdItemMapper.deleteByPrimaryKey(fid);
	}
	/**
	 * 根据名称查询扣款项目信息
	 */
	@Override
	public List<WithholdItem> selectWithholdItemByFname(String fnameL2, String companyId) {
		// TODO Auto-generated method stub
		Map<String, String> map = new HashMap<>();
		map.put("fnameL2", fnameL2);
		map.put("fid", companyId);
		return withholdItemMapper.selectWithholdItemByFname(map);
	}

	@Override
	public String selectFnumber(String companyId) {
		// TODO Auto-generated method stub
		return withholdItemMapper.selectFnumber(companyId);
	}

	@Override
	public List<WithholdItem> selectWithholdItemAll() {
		// TODO Auto-generated method stub
		return withholdItemMapper.selectWithholdItemAll();
	}

	@Override
	public List<WithholdItem> selectWithHoldItemByName(String name) {
		// TODO Auto-generated method stub
		return withholdItemMapper.selectWithHoldItemByName(name);
	}
	
	

}
